<template>
    <div class="app">
      <h3>我是APP组件（祖），{{name}}--{{price}}</h3>
      <ChildVue />
    </div>
</template>

<script>
  import { provide, reactive, toRefs } from 'vue';
import ChildVue from './components/Child.vue';
  export default {
    name:'App',
    components:{
      ChildVue
    },
    setup(){
      let car = reactive({name:'奔驰',price:'40W'})
      provide('car',car) // 给自己的后代组件传递数据
      return {...toRefs(car)}
    }
  }
</script>

<style>
  .app{
    background-color: gray;
    padding: 10px;
  }
</style>